// 子组件
<template>
  <div >
    <h1 @click="changeTitle">{{title}}</h1>
    <ul>
      <li v-for="user in users">{{user}}</li>
    </ul>


  </div>
</template>
<script>
  export default {
    name: 'BindSub',
    data(){
      return{
        title:'this is sub title'
      }
    },
    props: {
      users:{
        type:Array
      }
    },
    methods: {
      changeTitle(){
        this.$emit('titleChanged','sub to parent')
      }
    }
  };
</script>
